package com.lwj.liwanjia.presenter;

import com.lwj.liwanjia.bean.ShopLbBean;
import com.lwj.liwanjia.impl.ShopLbView;
import com.lwj.liwanjia.model.ShopBannerModel;

import rx.Subscriber;

/**
 * Created by Administrator on 2018/1/17.
 */

public class ShopBannerPresenter {
    private ShopBannerModel shopBannerModel;
    private ShopLbView shopLbView;

    public ShopBannerPresenter(ShopLbView shopLbView) {
        this.shopLbView = shopLbView;
        shopBannerModel = new ShopBannerModel();
    }

    public void getShopBanner() {
        shopBannerModel.getShopBanner(new Subscriber<ShopLbBean>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {
                shopLbView.showError((Exception) e);
            }

            @Override
            public void onNext(ShopLbBean shopLbBean) {
                shopLbView.getShopBanner(shopLbBean);
            }
        });
    }
}
